package com.ibm.cloud.banking.prod.service;


import com.ibm.cloud.banking.prod.dto.VendibiProdCondList;
import com.ibm.cloud.banking.prod.dto.VendibiProdSimpleConditionInfo;
import com.ibm.cloud.banking.prod.dto.VendibiProdtCmptInfoIn;
import com.ibm.cloud.banking.prod.dto.VendibiProdtCmptInfoOut;

import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 *
 */
@Service
public class VendibiCmptQueryComponentMock implements IVendibiCmptQueryComponent {

    @Override
    public VendibiProdtCmptInfoOut doNoTxProdtCmptInfo(VendibiProdtCmptInfoIn in) {
        VendibiProdtCmptInfoOut out = new VendibiProdtCmptInfoOut();
        out.setVendibiProdtNo("P20101060001");
        out.setVendibiProdtVerNo("v1");
        out.setProdtCmptName("个人存款存入组件");
        out.setProdtCmptNo("ZJXD00000273");
        out.setProdtCmptName("个人存款存入组件");

        List<VendibiProdSimpleConditionInfo> prodSimpleConditionInfoList = new ArrayList();
        VendibiProdSimpleConditionInfo prodCon1 = new VendibiProdSimpleConditionInfo();
        prodCon1.setProdtCondNo("CPCS0000000519");
        prodCon1.setProdtCondName("单笔开户金额下限");
        prodCon1.setCondParaEnSname("PER_OPENACC_LOW_LMT_AMT");
        prodCon1.setCondValTypeCode("02");
        prodCon1.setMeasureUnitCode("0803");
        prodCon1.setStepLenVal(new BigDecimal(0.01));
        prodCon1.setProdtCondMinVal(new BigDecimal(50.00));
        prodCon1.setProdtCondMaxVal(new BigDecimal(999999999));
        prodCon1.setUpLmtPackIncluFlag("0");
        prodCon1.setLowLmtPackIncluFlag("1");

        prodSimpleConditionInfoList.add(prodCon1);

        VendibiProdSimpleConditionInfo prodCon2 = new VendibiProdSimpleConditionInfo();
        prodCon2.setProdtCondNo("CPCS0000000526");
        prodCon2.setProdtCondName("单笔开户金额上限");
        prodCon2.setCondParaEnSname("PER_OPENACC_UP_LMT_AMT");
        prodCon2.setCondValTypeCode("02");
        prodCon2.setMeasureUnitCode("0803");
        prodCon2.setStepLenVal(new BigDecimal(0.01));
        prodCon2.setProdtCondMinVal(new BigDecimal(0.00));
        prodCon2.setProdtCondMaxVal(new BigDecimal(5000000.00));
        prodCon2.setUpLmtPackIncluFlag("1");
        prodCon2.setLowLmtPackIncluFlag("0");
        prodSimpleConditionInfoList.add(prodCon2);

        VendibiProdSimpleConditionInfo prodCon3 = new VendibiProdSimpleConditionInfo();
        prodCon3.setProdtCondNo("CPCS0000000507");
        prodCon3.setProdtCondName("结算账户类型");
        prodCon3.setCondParaEnSname("SET_ACC_TP_CD");
        prodCon3.setCondValTypeCode("01");
        List<VendibiProdCondList> prodCond3ValueList = new ArrayList<>();

        VendibiProdCondList cond3ValueL1 = new VendibiProdCondList();
        cond3ValueL1.setListItemNo("1");
        cond3ValueL1.setListVal("I类账户");
        prodCond3ValueList.add(cond3ValueL1);

        VendibiProdCondList cond3ValueL2 = new VendibiProdCondList();
        cond3ValueL2.setListItemNo("2");
        cond3ValueL2.setListVal("II类账户");
        prodCond3ValueList.add(cond3ValueL2);

        prodCon3.setListVals(prodCond3ValueList);

        prodSimpleConditionInfoList.add(prodCon3);

        out.setProdCondInfoList(prodSimpleConditionInfoList);

        return out;
    }
}
